<!DOCTYPE html>
<html lang="en">
<head>
  <title>浩然金融中心管理平台</title>
  <meta charset="utf-8">
  <meta content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"
        name="viewport">
  <#include "/common/csslib.html">
</head>
<body>
<div class="main-wrapper">
  <!-- start: MAIN CONTAINER -->
  <div class="main-container inner">
    <!-- start: PAGE -->
    <div class="main-content">
      <div class="container">
        <div class="form-horizontal  h-form-warp">
          <form action="/apiFacadeDoc/importApiFacadeDoc" class="form-horizontal" enctype="multipart/form-data"
                id="apiFacadeDocImportForm"
                method="post" role="form">
            <div class="form-group">
              <div class="file-loading">
                <input class="file" id="apiDocFile" name="apiDocFile" type="file">
              </div>
            </div>
            <div class="form-group">
              <button class="btn btn-primary" onclick="ImportMgr.importApiFacadeDoc()" type="button">确认导入</button>
            </div>
          </form>
        </div>
      </div>
    </div>
  </div>
</div>
<#include "/common/jslib.html">
<!-- bootstrap-fileinput begin -->
<script src="${staticPath!}/plugins/bootstrap-fileinput/js/plugins/sortable.js" type="text/javascript"></script>
<script src="${staticPath!}/plugins/bootstrap-fileinput/js/fileinput.js" type="text/javascript"></script>
<script src="${staticPath!}/plugins/bootstrap-fileinput/js/locales/fr.js" type="text/javascript"></script>
<script src="${staticPath!}/plugins/bootstrap-fileinput/js/locales/es.js" type="text/javascript"></script>
<script src="${staticPath!}/plugins/bootstrap-fileinput/themes/explorer-fa/theme.js" type="text/javascript"></script>
<script src="${staticPath!}/plugins/bootstrap-fileinput/themes/fa/theme.js" type="text/javascript"></script>
<!-- bootstrap-fileinput end -->
<script type="text/javascript">
    $(document).on('ready', function () {
        $("#apiDocFile").fileinput({
            theme: 'fa',
            uploadExtraData: {kvId: '10'},
            showUpload: false
        });
    });
    $(function () {
        var api = frameElement.api;
        var W = api.opener;
        ImportMgr = {
            importApiFacadeDoc: function () {
                var options = {
                    success: ImportMgr.callBackSuccess,
                    error: ImportMgr.callBackError
                }
                showloading();
                Jmts.submitForm($("#apiFacadeDocImportForm"), options);
            },
            callBackSuccess: function (data) {
                closeloading();
                Jmts.succTips("导入成功");
            },
            callBackError: function (data) {
                closeloading();
                Jmts.errorTips("导入失败:" + data.msg);
            }
        }
    });
</script>
</body>
